using System;
using System.Collections.Generic;
using System.Text;
using Shrapnel.Areas;
using System.Drawing;
using System.Runtime.Serialization;

namespace Shrapnel
{
	/// <summary>
	/// A connector to which cables can get attached
	/// </summary>
	[DataContract()]
	public class Connector
	{
		/// <summary>
		/// The area occupied by this connector
		/// </summary>
		[DataMember(Name="OccupiedArea")]
		private Area occupiedArea = new Area();

		/// <summary>
		/// The group this connector belongs to
		/// </summary>
		[DataMember(Name="GroupIndex")]
		private int groupIndex = 0;


		/// <summary>
		/// The offset from the occupiedArea's topLeftLocation from where
		/// any cable should start or end.
		/// </summary>
		[DataMember(Name="CableOriginOffset")]
		private SizeF cableOriginOffset = new SizeF(0, 0);


		/// <summary>
		/// Access to the occupied area of this connector
		/// </summary>
		public Area OccupiedArea 
		{
			get { return occupiedArea;  }
		}

		/// <summary>
		/// The group this connector belongs to
		/// </summary>
		public int GroupIndex
		{
			get { return groupIndex; }
			set { groupIndex = value; }
		}

		/// <summary>
		/// The offset from the occupiedArea's topLeftLocation from where
		/// any cable should start or end.
		/// </summary>
		public SizeF CableOriginOffset
		{
			get { return cableOriginOffset; }
			set { cableOriginOffset = value; }
		}

		/// <summary>
		/// Draw our connector
		/// </summary>
		/// <param name="graphics">Graphics object to use for drawing</param>
		/// <param name="viewState">ViewState to use for drawing</param>
		public virtual void Draw(Graphics graphics, ViewState viewState)
		{}

	}
}
